# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: William Rea <sillywilly@gmail.com>

pkgname=deepin-clutter
pkgver=1.26.2
pkgrel=3
pkgdesc="A toolkit for creating fast, portable, compelling dynamic UIs for Deepin"
arch=('loong64' 'x86_64')
url="https://github.com/sonald/clutter"
license=('LGPL')
depends=('gtk3' 'deepin-cogl' 'libinput')
makedepends=('gobject-introspection' 'gtk-doc')
provides=("clutter=$pkgver")
conflicts=('clutter')
source=("$pkgname-$pkgver.tar.gz::https://github.com/sonald/clutter/archive/$pkgver.tar.gz")
sha256sums=('08cc169af09b89a4fb09c38fa5732d7995f73f865783882f2bf91423830d97ba')

prepare() {
  cd clutter-$pkgver
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd clutter-$pkgver
  ./configure --prefix=/usr \
    --enable-introspection \
    --enable-egl-backend \
    --enable-gdk-backend \
    --enable-wayland-backend \
    --enable-x11-backend \
    --enable-evdev-input \
    --enable-wayland-compositor \
    --enable-gtk-doc

  # https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd clutter-$pkgver
  make DESTDIR="$pkgdir" install
}
